import request from '/src/axios.js';
import {baseUrl} from "../../config/env";

export const menuApi = {

  menuTree: (params) => request({
    url: baseUrl + '/api-user/menus/menuTree',
    method: 'get',
    params: params
  }),
  remove: (ids) => request({
    url: baseUrl + '/api-user/menus/remove/' + ids,
    method: 'post',
    // params: {
    //   ids,
    // }
  }),
  create: (row) => request({
    url: baseUrl + '/api-user/menus/create',
    method: 'post',
    data: row
  }),
  update: (row) => request({
    url: baseUrl + '/api-user/menus/update',
    method: 'post',
    data: row
  }),
  getMenuDetail: (id) => request({
    url: baseUrl + '/api-user/menus/detail',
    method: 'get',
    params: {
      id,
    }
  }),
  getLazyMenuList: (parentId, params) => request({
    url: '/api/blade-system/menu/lazy-menu-list',
    method: 'get',
    params: {
      ...params,
      parentId
    }
  })
}
